<?php
require_once("./BasePage.php");

class Page1 extends BasePage {
    function __construct() {
        parent::__construct();
        echo "<!--" . __CLASS__ . " constructed-->";
    }

    function __destruct() {
        echo "<!--" . __CLASS__ . " destructed-->";  
        parent::__destruct();
    }

    public function PrintHeader() {

        parent::PrintCommonHeader();

        echo "<h2>";
        echo "Page 1 Header";
        echo "<h2>";
    }

    public function PrintFooter() {
            
        echo "<h2>";
        echo "Page 1 Footer";
        echo "</h2>";
        echo "<p align='right'> Page generated on " . date(DATE_RFC822) . "</p>";
    }
}

$page1Object = new Page1;
?>

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
        <?php
            $page1Object->PrintHeader();
        ?>

        <a href="./Page2.php"><img src="http://www.bletchley-park.com/wp-content/uploads/2009/05/php.png" alt="Page2" /></a>

        <?php
            $page1Object->PrintFooter();
        ?>
    </body>
</html>
